﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace mealplanner.View
{
    public partial class mealPlaner : Form
    {
        public mealPlaner()
        {
            InitializeComponent();
        }

        private void pictureBox2_Click(object sender, EventArgs e)
        {

        }

        private void pictureBox4_Click(object sender, EventArgs e)
        {

        }

        private void pictureBox6_Click(object sender, EventArgs e)
        {
           // this.Visible = false;
            bool diet=true;
            bool valid=true;
            int from = 0;
            int to = 0;

            if(normal_choice.Checked){
                diet=false;
                valid = true;
            }
            else if (diet_choice.Checked)
            {
                diet = true;


                if (From.Value >= To.Value || From.Value == 0 || To.Value == 0)
                {
                    MessageBox.Show("Plaease Choose Valid Calorize Range");
                    valid = false;
                }
                else
                {
                    from = int.Parse(From.Value.ToString());
                    to = int.Parse(To.Value.ToString());
                    valid = true;
                }
            }
            else {
                valid = false;
            }
            
            if(valid){
            Menue1 menu = new Menue1(diet,from,to);

            menu.Show();
            }



        }

        private void Form3_MaximumSizeChanged(object sender, EventArgs e)
        {


        }

        private void mealPlaner_Load(object sender, EventArgs e)
        {
            diet_choice.Checked = false;
           // diet_choice.Checked = true;

        }

        private void diet_choice_CheckedChanged(object sender, EventArgs e)
        {
            if (diet_choice.Checked)
            {
                calorize_panel.Show();

            }
            

        }

        private void normal_choice_CheckedChanged(object sender, EventArgs e)
        {
            if (normal_choice.Checked)
            {
                calorize_panel.Hide();

            }
            

        }
    }
}
